<?php 

include_once("../function.php");
include_once("../class/bonus_class.php");
session_start();
header("Content-Type: text/html;charset=utf-8");
$my=getMemberbyID($_SESSION['ID']);
if ($_POST['submit1']){
	
	$UserID=$_POST['UserID'];
	$member=getMemberbyNickName($UserID);
	$bonus_cl=new bonus_class();
	$a=$_POST['uLevel'];
	if(checkUserID1($UserID,$my['id']) == false )
	{
		echo "<script language=javascript>alert('会员不存在或不在网体内,请检查后再试.');window.location.href='admin_jiesuan2.php?nickname=".$FatherName."&tid=".$TreePlace."'</script>";
	}else {
		edit_sql("update `member` set ulevel=$a where id=".$member['id']."");
		echo "<script language=javascript>alert('修改完毕.');window.location.href='admin_jiesuan2.php?nickname=".$FatherName."&tid=".$TreePlace."'</script>";
	}
}


?>
<?php 

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>奖金分红</title>
<link href="css/table.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<form action="?" method="post">
<table width="100%" cellpadding="3" cellspacing="1" border="0" align="center" class="table1">
  <tr>
<!--    	<td align="center">会员级别</td>-->
        <td align="center" >会员编号</td>
        <td align="center" >会员级别</td>
        <td align="center" >操作</td>
  </tr>
 <?php 
//  	$i=3;
  	$sql = "SELECT count(*) FROM member WHERE ulevel >0 ";
  	$query = mysql_query($sql);
  	while ($row=mysql_fetch_array($query)){
  ?>
    <td style="display:none;"><input type="hidden" name="id" value="<?=$i?>" /></td>
	<td align="center" ><input type="text" name="UserID" id="UserID" value="" maxlength="50" ></td>
<!--          <td align="center" ><input type="text" name="mey" /></td>-->    

    <td align="center">
      <select name="uLevel" id="uLevel">
      <?php
      	for($i=1;$i<=4;$i++){
      		$ul = ulevel($i);
	  ?>
        <option value="<?=$i?>"><?=$ul['lvname']?></option>
        <?php
		}
		?>
      </select></td>
          <td align="center" ><input type="submit" class="button" id="button1" name="submit1" value="修改" onClick="{if(confirm('您确定要修改吗?')){this.document.selform.submit();return true;}return false;} "/>
          </td>
          </tr>
  <?php }?>
</table>
</form>
</body>
</html>

